package edu.uwosh.cs342.project4;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class ManualCoordsActivity extends Activity{
	
	Button submit, cancel;
	double latCoord, lonCoord;
	TextView lat;
	TextView lon;
	public void onCreate(Bundle bundle) {
		super.onCreate(bundle);
		setContentView(R.layout.search);
		submit = (Button) findViewById(R.id.submitBtn);
		cancel = (Button) findViewById(R.id.cancelBtn);
		lat = (TextView) findViewById(R.id.latTxtBox);
		lon = (TextView) findViewById(R.id.longTxtBox);
		
		submit.setOnClickListener(new OnClickListener() {
			public void onClick(View v){
				latCoord = Double.parseDouble(lat.getText().toString());
				lonCoord = Double.parseDouble(lon.getText().toString());
				
				Intent manualIntent = new Intent(ManualCoordsActivity.this, Project4Activity.class);
				manualIntent.putExtra("lat", latCoord);
				manualIntent.putExtra("lon", lonCoord);
				startActivity(manualIntent);
			}
		});
	}

}
